#if !defined(MESH_H)
#define MESH_H

#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <string>
#include <vector>

using namespace std;

struct Vertex {
    // position
    glm::vec3 Position;
    // color
    glm::vec3 Color;
    // texCoords
    glm::vec2 TexCoords;
};

enum PrimitiveType
{
    PRIMITIVE_QUAD,
    PRIMITIVE_CUBE
};

class Mesh
{
private:
    vector<Vertex> _vertices;
    vector<unsigned int> _indices;
    unsigned int _VAO;
    // render data 
    unsigned int _VBO, _EBO;

    bool _isSetup;

    static Mesh *_createQuad();
    static Mesh *_createCube();

public:
    Mesh();
    ~Mesh();

    void setVertices(vector<Vertex> vertices);
    void setIndices(vector<unsigned int> indices);

    void setupMesh();
    void draw() const;

    static Mesh *createPrimitive(PrimitiveType type);
};


#endif // MESH_H
